<?php
/**
 * This class defined how a serialisableObject can be implement in application
 * @author Jonathan Rotini
 * @abstract
 * @version 1.0
 * @todo complement documentation
 */
abstract class SerialisableObject extends Object
{       
        /**
         * Serialize the object to the desired output format
         * Possible format : 'xml'
         * @access public
         * @final
         * @param String $format output format 
         * @return String
         * @todo Complete with other format
         */
        final public function serialize( $format = "xml" )
        {
                switch ($format)
                {
                        case "xml":
                                return $this->_formatToXml();
                        break;
                }
        }
        /**
         * Format the object to the XML format
         * @access protected
         * @abstract
         */
        abstract protected function _formatToXml();
}
?>